//
//  MVVMBaseViewModel.swift
//  test-ios
//
//  Created by wyz5204 on 2023/4/7.
//

import Foundation
import RxSwift

/**
 UI视图和逻辑结合
 */
class MVVMBaseViewModel : NSObject {
    
    func registerObserver(selector aSelector: Selector, name aName: NSNotification.Name? = nil, object anObject: Any? = nil){
        NotificationCenter.default.addObserver(self, selector: aSelector, name: aName, object: anObject)
    }
    
    func postMessage(_ aName: NSNotification.Name, object anObject: Any? = nil){
        NotificationCenter.default.post(name: aName , object: anObject)
    }
    
    
    deinit {
        NotificationCenter.default.removeObserver(self)
    }
    
}
